<?php

class Gallery_IndexController extends Crb_Controller
{
	
    public function preDispatch()
    {
        parent::preDispatch();
//        $this->view->headScript()->appendFile('stuff/lightbox/js/prototype.js');
//        $this->view->headScript()->appendFile('stuff/lightbox/js/scriptaculous.js?load=effects,builder');
        $this->view->headScript()->appendFile('/stuff/fancybox/jquery.fancybox-1.3.4.pack.js');
        $this->view->headLink()->appendStylesheet('/stuff/fancybox/jquery.fancybox-1.3.4.css');
    }
    
	public function indexAction()
	{
		$this->view->layout()->setLayout('layout');
	    $Gallery = new Gallery();
        $this->view->Galleries = $Gallery->getList(); 
	}
	
	
    public function listAction()
    {
        $this->view->layout()->setLayout('layout');
    	$Gallery = new Gallery();
        $this->view->Galleries = $Gallery->getList();  
    }
    
    public function viewAction()
    {
        $this->view->layout()->setLayout('layout');
    	$Gallery = new Gallery();
        $YID = $this->_request->getParam('id',0);
        $Y = $Gallery->getOne($YID);
        $this->view->Gallery = $Y; 
          
        $this->view->Title = $Y['Name']; 
        
    }
}

